#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->Tch = new Teacher(this);
    this->Stu = new Student(this);
    //依次为发送信号的对象,发送的信号类型,信号的接收者,处理信号的方式
    connect(Tch,&Teacher::Mysignal,Stu,&Student::StartStudy);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
      emit Tch->Mysignal();
}

